#!/usr/bin/bash

echo -e "\033[34m----------------------wsgi process----------------------\033[0m"

ps -ef|grep uwsgi_day_05.ini | grep -v grep

sleep 0.5

echo -e '\n-------------------going to close------------------------'

ps -ef |grep uwsgi_day_05.ini | grep -v grep | awk '{print $2}' | xargs kill -9

sleep 0.5

echo -e '\n-------------check if the kill action is correct-----------'

/usr/local/bin/uwsgi --ini uwsgi_day_05.ini &  >/dev/null

echo -e '\n\033[42;1m-------------------start...-------------------------\033[0m'

sleep 1

ps -ef|grep uwsgi_day_05.ini | grep -v grep